package umich.max.geolocation.experiments.geowords;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;

import max.nlp.dal.blog.blogger.BlogAuthorProfile;
import max.nlp.dal.blog.blogger.BloggerBlog;
import max.nlp.dal.blog.blogger.BloggerDB;
import max.nlp.dal.blog.blogger.BloggerPost;
import max.nlp.dal.blog.blogger.ParsedLocation;

import com.mongodb.DBCursor;

public class Experiment {
	HashMap<String, Integer> verbCount = new HashMap<String, Integer>();

	public void findPostsWithLocs() {
		try {
			PrintWriter out = new PrintWriter(new FileWriter(new File(
					"/home/max/temp-with.txt")));
			BloggerDB db = BloggerDB.getInstance();
			DBCursor itr = db.getBlogIterator();
			while (itr.hasNext()) {
				BloggerBlog blog = new BloggerBlog(itr.next());
				BlogAuthorProfile profile = db.findProfileForBlog(blog);
				ParsedLocation pLoc = profile.getParsedLocation();

				for (BloggerPost post : blog.getPosts()) {
					List<String> locs = post.getLocations();
					if (!locs.isEmpty()) {
						countVerbs(post.getCleanContent());
					}
				}
			}
			out.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void countVerbs(String text) {
		
	}

}
